﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace cinemawcftest.DBLayer
{
    public abstract class DataBase
    {
        static internal SqlConnection Connection = new SqlConnection("Data Source=balder.ucn.dk;Initial Catalog=dmaa0912_E8;Persist Security Info=True;User ID=dmaa0912_E8;Password=MaaGodt");



        ///// <summary>
        ///// Query = SQL Statement for den pågældende metode.
        ///// </summary>
        ///// <param name="query"></param>
        //public DataBase()
        //{

        //}

        //public void Reader(string query)
        //{
        //    //string[] rdrList;
        //    SqlDataReader rdr = null;
        //    try
        //    {

        //        conn.Open();

        //        SqlCommand cmd = new SqlCommand(query, conn);

        //        rdr = cmd.ExecuteReader();

        //        while (rdr.Read())
        //        {
        //            Console.WriteLine(rdr[0]);
        //        }

        //    }
        //    catch (Exception)
        //    {

        //        throw;
        //    }
        //    //Sørg for ALTID at lukke forbindelsen igen!
        //    finally
        //    {
        //        if (rdr != null)
        //        {
        //            rdr.Close();
        //        }
        //        if (conn != null)
        //        {
        //            conn.Close();
        //        }
        //    }
        //    //return rdrList;
    }

    

}
